Skip to content

feat: Milestone 2.1 l1 -> l2 messaging#703

Merged
Maddiaa0 merged 8 commits into
masterfrom
md/l1-l2-e2e
May 26, 2023
Merged

feat: Milestone 2.1 l1 -> l2 messaging#703
Maddiaa0 merged 8 commits into
masterfrom
md/l1-l2-e2e

Conversation

@Maddiaa0

@Maddiaa0 Maddiaa0 commented May 26, 2023

Copy link
Copy Markdown
Member

Description

Closes: #515
Completes private calls side of Milestone 2 (i think - :catjam:)

Checklist:

  • I have reviewed my diff in github, line by line.
  • Every change is related to the PR description.
  • I have linked this pull request to the issue(s) that it resolves.
  • There are no unexpected formatting changes, superfluous debug logs, or commented-out code.
  • The branch has been merged or rebased against the head of its merge target.
  • I'm happy for the PR to be merged at the reviewer's next convenience.

@Maddiaa0 Maddiaa0 marked this pull request as ready for review May 26, 2023 16:27
@Maddiaa0 Maddiaa0 requested a review from rahul-kothari May 26, 2023 16:27

// ********** Events that are processed inbetween blocks **********

// Process l1ToL2Messages, these are consumed as time passes, not each block

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah good catch!

});

router.get('/l1-l2-message-and-index', async (ctx: Koa.Context) => {
router.get('/l1-l2-message', async (ctx: Koa.Context) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great catch


// Wait for the archiver to process the message
const delay = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));
await delay(5000); /// waiting 1 second.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: waiting 5 seconds (fix comment)

const initialBalance = 10n;
const [ownerAddress, receiver] = accounts;
const ownerPub = await aztecRpcServer.getAccountPublicKey(ownerAddress);
const deployedContract = await deployContract(initialBalance, pointToPublicKey(ownerPub));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you rename this to deployedL2Contract? Since we have a contract in L1 and another on L2, can get quite confusing

logger('Consuming messages on L2');
// Call the mint tokens function on the noir contract
const mintAmount = 100n;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question - should we add expect() on methods in the archiver? See if the archiver actually processed everything correctly (i.e. added to pending store and later added to confirmed store)?

@Maddiaa0 Maddiaa0 May 26, 2023

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like a good to have, ill add this. edit: this seems more of a unit test thing rather than integration test thing, ill not do it here

@Maddiaa0 Maddiaa0 requested a review from rahul-kothari May 26, 2023 17:07
@Maddiaa0 Maddiaa0 requested a review from dbanks12 May 26, 2023 17:09

@rahul-kothari rahul-kothari left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOICEEE

@Maddiaa0 Maddiaa0 merged commit afadb91 into master May 26, 2023
@Maddiaa0 Maddiaa0 deleted the md/l1-l2-e2e branch May 26, 2023 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

E2E L1 -> L2

2 participants